/*
 * Copyright (c) 2023 iQi.Co.Ltd. All rights reserved.
 */
 
using IQIGame.Onigao.Framework;
using System.Collections.Generic;
using System.Linq;
using System;
using NetProtocol.Enum;

namespace NetProtocol.POD {

	/// <summary>
	///  逻辑服验证登录
	/// module : structs_internal
	/// </summary>
	public class LogicValidateLoginPOD : IPOD 
    {
        public readonly static Func<LogicValidateLoginPOD> FACTORY = () => new LogicValidateLoginPOD();
		public static Func<LogicValidateLoginPOD> DynamicFactory = FACTORY;
        
		/*-- members --*/
		/// <summary>
        /// 
        /// </summary>
		public string token;
		/// <summary>
        /// 
        /// </summary>
		public string logicServerId;
		
		
		
		/*-- constructors --*/
		public LogicValidateLoginPOD() {}
		public LogicValidateLoginPOD(string token, string logicServerId) {
			this.token = token;
			this.logicServerId = logicServerId;
		}
	      public void Serial(SOutputStream _out) {
            _out.Write_string(token);
            _out.Write_string(logicServerId);
        }
        
        public void UnSerial(SInputStream _in) {
            if(!_in.HasRemaining()) return;
            token = _in.Read_string();
            if(!_in.HasRemaining()) return;
            logicServerId = _in.Read_string();
        }
		
		public LogicValidateLoginPOD Clone() {
            LogicValidateLoginPOD o = DynamicFactory();
            o.token = token;
            o.logicServerId = logicServerId;
            return o;
        }
        
        public void Clear() {
            token = default;
            logicServerId = default;
        }
		
        public override string ToString() {
			string str = "";
			str += "LogicValidateLoginPOD [";
			str += "token=";
			str += token;
			str += ", logicServerId=";
			str += logicServerId;
			str += "]";
			return str;
		}
		
	}
}